package org.cuasloi.rabbitmq.basic;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class BasicSpringRabbitListener {

    /* 使用@RabbitListener注解配置侦听哪个队列，方法参数就是消息内容 */
    @RabbitListener(queues = "basic.queue")
    public void basicQueueListener(String msg) {
        System.out.println("接收到消息： " + msg);
    }

}
